<% layout('/layouts/default.html', {title: '学员信息表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> 学员信息表管理
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
				<% if(hasPermi('sm:smStudent:edit')){ %>
					<a href="${ctx}/sm/smStudent/form" class="btn btn-default btnTool" title="新增学员信息表"><i class="fa fa-plus"></i> 新增</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${smStudent}" action="${ctx}/sm/smStudent/listData" method="post" class="form-inline"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">姓名：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">所属驾校：</label>
					<div class="control-inline width-120" >
						<#form:treeselect id="officeId" title="驾校"
							path="officeId" labelPath="" 
							url="${ctx}/sys/office/treeData" allowClear="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">报名时间：</label>
					<div class="control-inline">
						<#form:input path="signupTime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">受理人：</label>
					<div class="control-inline width-120" >
						<#form:treeselect id="employeeId" title="用户"
							path="employeeId" labelPath="acceptor.userName"
							url="${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">查询</button>
					<button type="reset" class="btn btn-default btn-sm">重置</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'证件号', name:'idno', index:'a.idno', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/sm/smStudent/form?id='+row.id+'" class="btnList" data-title="编辑学员信息表">'+(val||row.id)+'</a>';
		}},
		{header:'姓名', name:'name', index:'a.name', width:150, align:"left"},
		{header:'性别', name:'sex', index:'a.sex', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_user_sex')}, val, '未知', true);
		}},
		{header:'出生日期', name:'birthDate', index:'a.birth_date', width:150, align:"center"},
		{header:'籍贯', name:'nativePlace', index:'a.native_place', width:150, align:"left"},
		{header:'户口所在地', name:'regPlace', index:'a.reg_place', width:150, align:"left"},
		{header:'住址', name:'address', index:'a.address', width:150, align:"left"},
		{header:'联系电话', name:'telephone', index:'a.telephone', width:150, align:"left"},
		{header:'所属驾校', name:'school.officeName', index:'a.office_id', width:150, align:"center"},
		{header:'报名时间', name:'signupTime', index:'a.signup_time', width:150, align:"center"},
		{header:'受理人', name:'acceptor.userName', index:'a.employee_id', width:150, align:"center"},
		{header:'操作', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('sm:smStudent:edit')){ %>
				actions.push('<a href="${ctx}/sm/smStudent/form?id='+row.id+'" class="btnList" title="编辑学员信息表"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/sm/smStudent/delete?id='+row.id+'" class="btnList" title="删除学员信息表" data-confirm="确认要删除该学员信息表吗？"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>